<!DOCTYPE HTML>
<title>Test that media constructors behave consistently.</title>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<video></video>
<audio></audio>
<script>
test(function() {
    var audioJS = new Audio();
    var videoElem = document.querySelector("video");
    var audioElem = document.querySelector("audio");

    assert_true(audioJS instanceof HTMLAudioElement);
    assert_true(audioJS instanceof HTMLMediaElement);
    assert_false(audioJS instanceof HTMLVideoElement);

    assert_true(audioElem instanceof HTMLAudioElement);
    assert_true(audioElem instanceof HTMLMediaElement);
    assert_false(audioElem instanceof HTMLVideoElement);

    assert_true(videoElem instanceof HTMLVideoElement);
    assert_true(videoElem instanceof HTMLMediaElement);
    assert_false(videoElem instanceof HTMLAudioElement);
});
</script>